appModule.component('scheduleList', {
  templateUrl: 'components/meeting-home/schedule-list/schedule-list.template.html',

  controller: [
    '$scope', '$compile',
    function ($scope, $compile) {

      let scheduleList = `
<ul class="schedule-list-ul">
  <li class="schedule-date"><md-datepicker ng-model="xx" md-placeholder="选择日期" md-open-on-focus></md-datepicker></li>
  <li class="schedule-time"><input type="time" ng-model="schedule.time"/></li>
  <li class="schedule-theme"> <input type="text"  placeholder="请输入会议主题"/></li>
  <li class="schedule-lecturer"><input type="text"  placeholder="请输入演讲者"/></li>
  <li class="schedule-compere"><input type="text"  placeholder="请输入主持人"/></li>
  <li class="schedule-add" ng-click="scheduleAdd($event)">+</li>
  <li class="schedule-del" ng-click="scheduleDel($event)">-</li>
</ul>
`;


      $scope.scheduleAdd = function ($event) {
        let template = angular.element(scheduleList);
        let AddScheduleList = $compile(template)($scope);
        //angular.element(document.querySelector(".schedule-add")).parent().after(AddScheduleList);  //after 只会找第一个匹配者
        angular.element(document.querySelector(".schedule-add")).parent().parent().append(AddScheduleList);  
        //angular.element(document.querySelector(".schedule-list-ul")).removeClass("ng-scope");
        console.log(this)
      };


      $scope.scheduleDel = function(){
        angular.element(document.querySelector(".schedule-del")).parent().remove();   //删除的第一个匹配者
        //console.log(this)
      }

    },


  ]
});



